package com.flash.BusinessParameters.mapper;

import com.flash.BusinessParameters.entity.Broker;
import com.flash.BusinessParameters.entity.ExchangeRate;
import org.apache.ibatis.annotations.*;

import java.util.List;
import java.util.Map;
@Mapper
public interface ExchangeRateMapper {

    @Select("select * from exchangeRate")
    List<ExchangeRate> selectExchangeRate();

    @Insert("insert into exchangeRate values(#{exchangeName},#{exchangeType},#{stampDuty},#{transferFee},#{collectionFee},#{handlingFee})")
    int insertExchangeRate(ExchangeRate exchangeRate);

    @Delete("delete from exchangeRate where exchangeName=#{exchangeName}")
    int deleteExchangeRate(int exchangeName);

    @Update("update exchangeRate set exchangeType = #{exchangeType},stampDuty = #{stampDuty},transferFee = #{transferFee},collectionFee = #{collectionFee} ,handlingFee = #{handlingFee}where exchangeName=#{exchangeName}")
    int updateExchangeRate(ExchangeRate exchangeRate);

    @Select("select * from (select rownum rn,b.* from ExchangeRate b) where 1=1 ${strWhere} and  rn between #{page} and #{limit} ")
    List<ExchangeRate> selectExchangeRateMap(Map map);
    @Select("select * from ExchangeRate where exchangeType=#{exchangeType}")
    List<ExchangeRate> selectExchangeRateMap2(int exchangeType);
    @Select("select count(*) from ExchangeRate")
    int selectCountExchangeRate();
}
